import "@site/src/languages/highlight";

# Spine

**Description:**

&emsp;&emsp;An implementation of an animation system using the Spine engine.

**Class Object:** [Spine Class](/docs/api/Class%20Object/Spine).

**Inherits from:** [Playable](/docs/api/Class/Playable).

## hitTestEnabled

**Type:** Field.

**Description:**

&emsp;&emsp;Whether hit testing is enabled.

**Signature:**
```tl
hitTestEnabled: boolean
```

## setBoneRotation

**Type:** Function.

**Description:**

&emsp;&emsp;Sets the rotation of a bone in the Spine skeleton.

**Signature:**
```tl
setBoneRotation: function(self: Spine, name: string, rotation: number): boolean
```

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| name | string | The name of the bone to rotate. |
| rotation | number | The amount to rotate the bone, in degrees. |

**Returns:**

| Return Type | Description |
| --- | --- |
| boolean | Whether the rotation was successfully set or not. |

## containsPoint

**Type:** Function.

**Description:**

&emsp;&emsp;Checks if a point in space is inside the boundaries of the Spine skeleton.

**Signature:**
```tl
containsPoint: function(self: Spine, x: number, y: number): string | nil
```

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| x | number | The x-coordinate of the point to check. |
| y | number | The y-coordinate of the point to check. |

**Returns:**

| Return Type | Description |
| --- | --- |
| string\|nil | The name of the bone at the point, or nil if there is no bone at the point. |

## intersectsSegment

**Type:** Function.

**Description:**

&emsp;&emsp;Checks if a line segment intersects the boundaries of the instance and returns the name of the bone or slot at the intersection point, or nil if no bone or slot is found.

**Signature:**
```tl
intersectsSegment: function(self: Spine, x1: number, y1: number, x2: number, y2: number): string | nil
```

**Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| x1 | number | The x-coordinate of the start point of the line segment. |
| y1 | number | The y-coordinate of the start point of the line segment. |
| x2 | number | The x-coordinate of the end point of the line segment. |
| y2 | number | The y-coordinate of the end point of the line segment. |

**Returns:**

| Return Type | Description |
| --- | --- |
| string\|nil | The name of the bone or slot at the intersection point, or nil if no bone or slot is found. |